package com.youliao.spring5.service;

import com.youliao.spring5.dao.UserDao;
import com.youliao.spring5.dao.UserDaoImpl;
import sun.java2d.pipe.SpanIterator;

import java.sql.SQLOutput;

/**
 * @Author Dali
 * @Date 2021/5/3 17:55
 * @Version 1.0
 * @Description
 */
public class UserService {

    //创建UserDao类型属性，生成set方法

    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public void add() {
        System.out.println("service add..........");
        /*原始方式
        //创建UserDao对象
        UserDao userDao = new UserDaoImpl();
        userDao.update();*/



        userDao.update();
    }
}
